//
//  OneViewController.m
//  ConvertLanguage
//
//  Created by Burn on 2019/4/17.
//  Copyright © 2019 menksoft. All rights reserved.
//

#import "OneViewController.h"
#import "MainTabBarController.h"
#import "OneMViewController.h"
#import "SeconMViewController.h"
#import "MainNavigationController.h"

@interface OneViewController ()

@end

@implementation OneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor cyanColor];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(0, 0, 50, 50);
    btn.center = self.view.center;
    btn.backgroundColor = [UIColor orangeColor];
    [btn addTarget:self action:@selector(convertLanguage) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
}

- (void)convertLanguage{
    MainTabBarController *mainTabbar = [[MainTabBarController alloc]init];
    
    OneMViewController *one = [[OneMViewController alloc]init];
    SeconMViewController *second = [[SeconMViewController alloc]init];
    
    MainNavigationController *oneNav = [[MainNavigationController alloc]initWithRootViewController:one];
    MainNavigationController *seconNav = [[MainNavigationController alloc]initWithRootViewController:second];
    
    [mainTabbar addChildViewController:oneNav];
    [mainTabbar addChildViewController:seconNav];
    [UIApplication sharedApplication].keyWindow.rootViewController = mainTabbar;
    
}




@end
